// ActionScript file
package component
{
 
import flash.events.FocusEvent;

import mx.controls.menuClasses.MenuBarItem;
 
	public class MyMenuBarItem extends MenuBarItem
	{
		private var leftMargin:int = 20;
		
		override protected function commitProperties():void
		{
			super.commitProperties();
		}
		
		override public function invalidateDisplayList():void
		{
			super.invalidateDisplayList();
		}
		
	    override protected function updateDisplayList(unscaledWidth:Number,
	                                                  unscaledHeight:Number):void
	    {
	    	super.updateDisplayList(unscaledWidth, unscaledHeight);
	        
	        if (icon)
	        {
	            icon.x = label.width+5;
	            icon.setActualSize(icon.measuredWidth, icon.measuredHeight);
	            label.x = 2;
	        }
	        else
	            label.x = leftMargin / 2;
	            
	        label.setActualSize(unscaledWidth - leftMargin, 
	            label.getExplicitOrMeasuredHeight());
	            
	        label.y = (unscaledHeight - label.height) / 2;
	        
	        if (icon)
	            icon.y = (unscaledHeight - icon.height) / 2;
	            
	        menuBarItemState = "itemUpSkin";
	    }
	    
	    
	    
	}
}
